Ok thanks a lot, I see what was wrong.
In fact I was lauching emulationstation from the .xinitrc file because I wanted to avoid using openbox. But is seem not to be possible. To make it as clean as possible I edited my files like so:
/home/pi/.initrc
exec openbox-session
This will start an openbox session in X and trigger the autostart file that i edited like so:
/home/pi/.config/openbox/autostart
xterm -fg white -bg black emulationstation -fullscreen
This will lauch emulationstation in a black xterm terminal in fullscreen which is used to display the file manager or retropie setup.